package prefix.platform;

import java.awt.Color;
import java.awt.Dimension;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;

import play.Logger;
import prefix.util.Timeable;

public class Constants {

    public final static int CART_EXPIRE_MINS = 30;

    /** The current year for now, used in the footer of the page. */
    public static final int CURRENT_YEAR = Calendar.getInstance().get(Calendar.YEAR);

    public static int ResultsetSize = 10000;

    public static int MinNumberAllowedInPortfolio = 0;

    public static int SearchResultPageSize = 15;

    // public static Dimension GraphDimension = new Dimension(240, 150);
    public static Dimension GraphDimension = new Dimension(100, 100);

    public static Color DarkBlue = new Color(84, 118, 153);

    public static Color Purple = new Color(153, 119, 187);

    public static Color Green = new Color(151, 202, 0);

    public static Color LightBlue = new Color(145, 169, 195);

    public static int MINIMIM_FICO_FOR_COSIGNER = 620;

    public static String NO_CLASS = "NO_CLASS_DB"; // a dummay loan class name,
                                                   // note do not add this to
                                                   // the enum

    public static int LOAN_APP_DURATION_IN_DAYS = 14;

    public static long LOAN_APP_DURATION = LOAN_APP_DURATION_IN_DAYS * Timeable.DAY;

    public static long PORTFOLIO_TIMEOUT = Timeable.MINUTE * 20;

    public static int ROUNDING_UNIT = 100;

    public static long MINIMUM_AMOUNT_TO_LEND = 100;

    public static long MINIMUM_AMOUNT_TO_BORROW = 200; // Temporary changed to
                                                       // 200, restore to 2500
                                                       // after testing

    public static long MINIMUM_FOR_60_MNTH_DEFAULT_OFFER = 16000;

    public static String ENTRUST_CAMA_ACCOUNT_NAME = "Entrust Cama";

    public static String SDIRA_ACCOUNT_NAME = "SDIRA Services";

    public static long BANKSERV_CONN_REFRESH_PERIOD = 10 * Timeable.MINUTE; // 1
                                                                            // min

    // public static long
    // ------------------------------------------------------------------------------------------

    public static double INVENTORY_CHANGE = 0.05;

    public static double MinOriginatioinFee = 0.0;

    public static double BROWSE_AMT_TO_INVEST = 25.0;

    public static int RELIST_DAYS = 45;

    public static int AUTOMATIC_BORROWER_CANCEL_DAYS = 30;

    public static int MAX_SSN_MATCH_TRY_COUNT = 3;

    public static int MAX_BORROWER_DOC_VERSIONS = 50;

    public static int MAX_DM_FAILED_COUNT = 3;

    public static int BORROWER_MAX_ACCOUNTS = 2;

    public static int LENDER_MAX_ACCOUNTS = 4;

    public static final int ACH_PMT_WITHDRAWAL_BUFFER_DAYS = 0;

    public static final int GRACE_PERIOD_DAYS = 7;

    public static final int DELINQUENT_PERIOD_DAYS = 31;

    public final static double LateFees = 35.0;

    // ------------------------------------------------------------------------------------------
    // Colors
    public final Color colorA = new Color(Integer.parseInt("94c384", 16));

    public final Color colorB = new Color(Integer.parseInt("6e85e8", 16));

    public final Color colorC = new Color(Integer.parseInt("8cbece", 16));

    public final Color colorD = new Color(Integer.parseInt("ffba4a", 16));

    public final Color colorE = new Color(Integer.parseInt("9c6929", 16));

    public final Color colorF = new Color(Integer.parseInt("e77542", 16));

    public final Color colorG = new Color(Integer.parseInt("ce9e73", 16));

    // ------------------------------------------------------------------------------------------

    // Formatter ---------------------------------------------------------
    public final static DecimalFormat RateFormat = new DecimalFormat("#.00");

    public final static DecimalFormat PieFormat = new DecimalFormat("00.0");

    public final static DecimalFormat RiskFormat = new DecimalFormat("#.#");

    public final static DecimalFormat d7 = new DecimalFormat("#.0000000");

    public final static DecimalFormat d3 = new DecimalFormat("0.0000");

    public final static DecimalFormat d2 = new DecimalFormat(".00");

    public final static DecimalFormat d1 = new DecimalFormat(".0");

    public final static DecimalFormat i2 = new DecimalFormat("00");

    public final static DecimalFormat i3 = new DecimalFormat("000");

    public final static DecimalFormat ddd = new DecimalFormat("#.##");

    public final static NumberFormat currency = NumberFormat.getCurrencyInstance();

    // ------------------------------------------------------------------------------------------

    public static double LM_THRESHOLD_AMOUNT = 5000.0;

    // ------------------------------------------------------------------------------------------
    public static double DB_FLOAT_SCALE = 1000000000000d;

    public static double SENSITIVITY_ERROR = 0.0001;

    public static double SENSITIVITY_ERROR_CENT = 0.01;

    public static double SENSITIVITY_ERROR_1DOLLAR = 1.0;

    public static double PRINCIPAL_RECEIVED_SENSITIVITY_ERROR = 0.3;

    public static double PRINCIPAL_REMAINING_SENSITIVITY_ERROR = 2;

    public static double PRINCIPAL_BALANCE_PENALTY_5CENT = 0.05;

    public static double ROUNDING_PAYMENT_ERROR = 10.0;

    // maximum amount to use for add funds
    public static double MAX_ADD_FUNDS_AMOUNT = 9999999999.99;

    public static double MAX_ACH_LOAD_AMOUNT = 500000d;

    // Default income incase we recieve a loan application with no income
    // information
    public static double DEFAULT_INCOME = 12000;

    public static double PAYMENT_MIN_LATE_FEES = 15;

    public static double PAYMENT_LATE_FEE_PERCENT = 0.0005;

    public static double DEFAULT_UNPAID_LIMIT = 4;

    public static final int ACH_REPRESENTMENT_DELAY_IN_DAYS = 4;

    int MAX_ATTEMPTS = 10;

    public static int SECURITY_LISTING_DAYS = 30;

    public static String DEFAULT_PORTFOLIO_NAME = "__DEFAULT_PORTFOLIO";

    // Batch Automation ---
    public static int PULL_SCHEDULE_HOUR = 12;

    public static int ACH_BATCH_CUT_OFF_HOUR = 24;

    public static int LOAN_ISSUING_CUT_OFF_HOUR = 24;

    public static int TRADE_ACCEPTANCE_CUT_OFF_HOUR = 1;

    public static int EARLIEST_STATEMENT_DAY = 7;

    public static GregorianCalendar MTL_STATEMENT_CUTOFF = new GregorianCalendar(2008, Calendar.SEPTEMBER, 30);

    public static int INVEST_TRIGGER_LIMIT = 1;

    public static int FUNDING_TRIGGER_LIMIT = 1;

    public static int FUNDING_TRIGGER_END_MONTHS = 12;

    public static double DTI4_LIMIT = 60;

    public static String KEY_TOKEN = "$_INVITE_KEY_$";

    // Redirects --

    public static String uncrunchRedirect = "/uncrunchAmerica/registerLender.action?src=67486";

    // ------------------------------------------------------------------------------------------------

    public static double BONUS_BLOGGER = 25.0;

    public static double BONUS_LEVEL_1 = 25.0;

    public static double BONUS_LEVEL_2 = 15.0;

    public static double BONUS_LEVEL_3 = 10.0;

    // Referal amounts ---
    public static double BORROWER_INCENTIVE_BORROW_CPA_0001_0 = 25.0;

    public static double BORROWER_REFERAL_BORROWER_CPA_0001_0 = 100.0;

    public static double INVESTOR_REFERAL_BORROWER_CPA_0001_0 = 100.0;

    // ------------------------------------------------------------------------------------------------

    // White Label
    public static String WHITELABEL = "siteID";

    public static double MAX_ROUNDING_CORRECTION = 20.0;

    public static double MAX_FRACTION_ROUNDING_CORRECTION = 1.0;

    public static double DEFAULT_WAROIC = 0.990;

    public static GregorianCalendar LC_START_DATE = new GregorianCalendar(2007, Calendar.MAY, 01, 0, 0, 0);

    public static GregorianCalendar LC_FIRST_PAYMENT = new GregorianCalendar(2007, Calendar.JULY, 01, 0, 0, 0);

    public static GregorianCalendar PROSPECTUS_DATE = new GregorianCalendar(2011, Calendar.AUGUST, 19, 0, 0, 0);

    // ------------------------------------------------------------------------------------------------

    public static double LENDER_SERVICE_FEE_RATE = 0.01;

    public static int EXPIRATION_DAYS_ON_HOLD = 60;

    public static double BORROWER_BONUS_LOAN_AMT_LIMIT = 50000d;

    // ----------------------------------------------------------------------------------------------
    public static int MAX_NUMBER_DIRECT_MAIL_CODE_ATTEMPTS = 4;

    public static double CHINA_PNR_MAX_WITHRAW = 200000;

    public static int CHINA_PNR_RECON_DELAY = 5;

    public static double TENPAY_MAX_WITHRAW = -1; // tenpay does have limit ,so
                                                  // we set it as negative 1;

    public static int TENPAY_RECON_DELAY = 5;

    public static final int CHINA_PNR_ADD_FUNDS_CONVERT_DEALY = 30;
    
    //New start

    public static final String BORROWERDOCSROOT = "D:/p2p_content/";

    public static final String DATASOURCEKEY = "default";

    public static final int DAYS_BEFORE_NOTIFICATION = 4;

    public static final int DAYS_BEFORE_PULL = 2;

    public final static String APPLICATION = "application";
    
    public final static String CONTENT_ROOT = "D:/p2p_content/";
    
    public final static String INSTANCE = "DEV";
    
    public static final String SESSION_AUTH_KEY = "auth_key";
    
    public static final String UUID = "uuid";
    

}
